package com.bgt.springboot.first.repository;

import com.bgt.springboot.first.vo.Food;
import org.hibernate.sql.Select;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by baiguantao on 2017/4/26.
 */
@Repository
public interface FoodRepository extends CrudRepository<Food, Integer> {
    @Query("select f from Food f where f.categoryId=?1")
    public List<Food> findByCategoryId(Integer categoryId);
}
